package com.rpg.entidades;

import java.util.Random;

import com.rpg.enuns.NomeClasse;

public class Cientista extends Protagonista {

	private static final int CONSTSKILL1KISSOFDEATH = 300; 
	private static final int CONSTSKILL1VITAMINCOMPOUND = -15;
	private static final int CONSTSKILL1RICINSERUM = 30;
	private static final int CONSTSKILL1BIGPOTION = -10; 

	public Cientista() {
		super();
		Random gerador = new Random();

		nome = NomeClasse.CIENTISTA;
		vidaMax = 170 + gerador.nextInt(5);
		manaMax = 70;
		vidaAtual = vidaMax;
		manaAtual = manaMax;
		recuperacaoMana = 7;
		poderAtaque = 15 + gerador.nextInt(5);
		poderDefesa = 40 + gerador.nextInt(7);
		custoManaSkill1 = 25;
		custoManaSkill2 = 0;

	}

	@Override
	public Integer getPrimarySkill() {
		this.manaAtual -= 25;
		Random gerador = new Random();
		int n = gerador.nextInt(100);

		if (n <= 1) {
			return CONSTSKILL1KISSOFDEATH; // 1% de chance de matar

		} else if (n > 1 && n <= 71) { // 70 % de chance de curar (20 + 10% hp)
			Integer percentage = (int) Math.round((0.1 * this.getVidaAtual()));
			return CONSTSKILL1VITAMINCOMPOUND + percentage;
 
		} else if (n > 71 && n <= 96) { // 25% de chance de atacar (30 dmg)
			return CONSTSKILL1RICINSERUM;

		} else { // 4 % de chance de curar (30 + 30% hp)
			Integer percentage = (int) Math.round((0.3 * this.getVidaAtual()));
			return CONSTSKILL1BIGPOTION + percentage;
		}
	}

	@Override
	public Integer getSecundarySkill() {
		return null;
	}

	
}
